package com.situ.web.controller;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
//@WebServlet("life")
//Caused by: java.lang.IllegalArgumentException: Invalid <url-pattern> [life] in servlet mapping
//<url-pattern>

//@WebServlet("/student")
//Caused by: java.lang.IllegalArgumentException: The servlets named [com.situ.web.servlet.LifeServelt] and [com.situ.web.servlet.StudentServlet] are both mapped to the url-pattern [/student] which is not permitted

@WebServlet("/life")
public class LifeServelt extends HttpServlet {

    public LifeServelt() {
        System.out.println("LifeServelt.LifeServelt");
    }

    @Override
    public void init() throws ServletException {
        super.init();
        System.out.println("LifeServelt.init");
    }

    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("LifeServelt.service");
    }

    @Override
    public void destroy() {
        super.destroy();
        System.out.println("LifeServelt.destroy");
    }
}
